import Vue from 'vue'
const commonData = {
  install(Vue) {
    Vue.prototype.commonData = {
      val: function(val) {
        return val
      },
      keyWords: '博雅书院，名著在线，金庸全集，三体，三毛全集',
      email: 'boyashuyuan@yandex.com',
      categoryPageHistoryKey:'categoryPageHistory',
      savePageHistroy: function(key,pageData) {
        localStorage.setItem(key, JSON.stringify(pageData))
      },
      clearPageHistory: function(key) {
        localStorage.removeItem(key)
      },
      getPageHistory: function(key) {
        let dataStr = localStorage.getItem(key)
        return dataStr ? JSON.parse(dataStr) : null
      },
    }
  }
}
Vue.use(commonData)